import request from '@/axios';

export const getList = (params) => {
  return request({
    url: '/blade-iot/category/function/list',
    method: 'get',
    params: {
      ...params,
    }
  })
}

export const getDetail = (functionId, functionType) => {
  return request({
    url: '/blade-iot/category/function/detail',
    method: 'get',
    params: {
      functionId,
      functionType
    }
  })
}

export const remove = (functionId, functionType) => {
  return request({
    url: '/blade-iot/category/function/remove',
    method: 'post',
    params: {
      functionId,
      functionType
    }
  })
}

export const add = (row) => {
  return request({
    url: '/blade-iot/category/function/save',
    method: 'post',
    data: row
  })
}

export const update = (row) => {
  return request({
    url: '/blade-iot/category/function/update',
    method: 'post',
    data: row
  })
}

export const publishOnline = (categoryId, versionDesc) => {
  return request({
    url: '/blade-iot/category/function/publish-online',
    method: 'post',
    params: {
      categoryId,
      versionDesc
    }
  })
}

